package com.wudl.govern.service.impl;

import com.github.pagehelper.PageHelper;
import com.wudl.govern.domain.entity.StandardTheme;
import com.wudl.govern.mapper.StandardThemeMapp;
import com.wudl.govern.service.StandardThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 标准主题 Service
 *
 * @author wudl
 */
@Service
public class StandardThemeServiceImpl implements StandardThemeService {

    @Autowired
    private StandardThemeMapp standardThemeDao;

    /**
     * 分页查询
     */
    @Override
    public List<StandardTheme> page(Integer page, Integer size) {
        PageHelper.startPage(page, size);
        List<StandardTheme> standardThemes = standardThemeDao.selectList();

        return standardThemes;
    }

    /**
     * 获取
     */
    @Override
    public StandardTheme getById(Object id) {
        return standardThemeDao.selectById(id);
    }

    /**
     * 保存
     */
    @Override
    public void save(StandardTheme standardTheme) {
        standardThemeDao.insert(standardTheme);
    }

    /**
     * 更新
     */
    @Override
    public void updateById(StandardTheme standardTheme) {
        standardThemeDao.updateById(standardTheme);
    }

    /**
     * 删除
     */
    @Override
    public void removeById(Object id) {
        standardThemeDao.deleteById(id);
    }

}